package model.newhouse.service.impl;

import model.newhouse.entity.Newhouse;
import model.newhouse.mapper.NewhouseMapper;
import model.newhouse.service.INewhouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


import java.util.List;


@Service
@Transactional
public class NewServiceImpl implements INewhouseService {

    @Autowired
    private NewhouseMapper newhouseMapper;

    @Override
    public void save(Newhouse newhouse) {
        newhouseMapper.save(newhouse);
    }

    @Override
    public void del(String newhouseId) {
        newhouseMapper.del(newhouseId);
    }

    @Override
    public void update(Newhouse newhouse) {
        newhouseMapper.update(newhouse);
    }

    @Override
    public List<Newhouse> findAll() {
        return newhouseMapper.findAll();
    }

    @Override
    public List<Newhouse> findByMetro(String newhouseMetro, String newhouseSchool, String newhouseCommerce) {
        return newhouseMapper.findByMetro(newhouseMetro,newhouseSchool,newhouseCommerce);
    }


//    @Override
//    public List<Newhouse> findByMetro(String newhouseMetro) {
//        return newhouseMapper.findByMetro(newhouseMetro);
//    }
//
//    @Override
//    public List<Newhouse> findBySchool(String newhouseSchool) {
//        return newhouseMapper.findBySchool(newhouseSchool);
//    }
//
//    @Override
//    public List<Newhouse> findByCommerce(String newhouseCommerce) {
//        return newhouseMapper.findByCommerce(newhouseCommerce);
//    }
}
